package top.continew.wechat.common.entity;

import lombok.Data;
import top.continew.wechat.common.constant.CommonConstant;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.io.Serializable;

/**
 * 分页请求基类
 */
@Data
public class PageRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 页码
     */
    @Min(value = 1, message = "页码不能小于1")
    private Integer pageNum = CommonConstant.DEFAULT_PAGE_NUM;

    /**
     * 每页大小
     */
    @Min(value = 1, message = "每页大小不能小于1")
    @Max(value = 100, message = "每页大小不能大于100")
    private Integer pageSize = CommonConstant.DEFAULT_PAGE_SIZE;
}
